home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 051-075 / scopedisk53 / sh / readme < prev    next >
Text File  |  1995-03-18  |  3KB  |  71 lines

  1. SH -- by Jim Guilford
  2.  
  3. This is my version of a utility to unshar files. I wrote it as I found
  4. existing programs to be unreliable and limited. This works to the best
  5. of my knowledge, but I make no guarrantees.
  6.  
  7. The program knows four simple sh commands: echo, cat, sed, and exit.
  8. The version of sed that I've implemented is SEVERELY limited, but does
  9. manage to unshar all of the shar files I've seen which use sed. If sh
  10. finds any other commands, it ignores them.
  11.  
  12. Sh is invoked as
  13. sh [options] [filename]
  14. If the filename is omitted, the standard input is taken. The options
  15. can be given individually (e.g. -s1 -o1), or combined (e.g. -s1o1).
  16. The options are as follows:
  17. -v0 == verbosity of zero. Don't print what isn't understood
  18. -v1 == verbosity of one. Print what isn't understood
  19. -v2 == verbosity of two. Print what isn't understood and commands as
  20.        they are executed. This will only echo the cat and sed
  21.        commands. I thought that echoing the 'echo' command was rather
  22.        silly, as is echoing 'exit'.
  23. -v  == without a number is defaults to -v1
  24. -s0 == safety off. Continue if something is not understood
  25. -s1 == safety on. Stop the first time something is not understood (in
  26.        case you are paranoid).
  27. -s  == defaults to -s1
  28. -o0 == overwrite off. Don't check for overwriting existing files.
  29. -o1 == overwrite on. Don't overwrite files if they already exist
  30. -o  == defaults to -o1
  31.  
  32. The defaults as compiled into the program are:
  33. -v1 -s0 -o1
  34.  
  35. Known bugs:
  36.   In evaluating tokens, I handle quotes properly. The only escape
  37. character for which I check, however, is the back-slash, '\'. This is
  38. removed, and the next character is taken as is. If a token contains
  39. any other escape characters, then it won't be parsed properly.  If
  40. this happens to the token following the '<<', then essentially all of
  41. the shar file will be dumped into the first file that was to be
  42. unshared.  This is a good indication that funny characters are around.
  43. If this happens, then the easiest way to fix it is to zip into your
  44. favorite editor and change one of the pair of terminating string to
  45. match the other. This can usually be done with one global search and
  46. replace (once you know the changes to be made). 
  47.  
  48. Programmer's Notes:
  49.   The program is designed to be modular and easily enhanced to
  50. understand a new shar form. It currently understands the following:
  51. cat << some-string > file-name
  52. cat << some-string >> file-name
  53. sed s/^X// << some-string > file-name
  54. sed s/^X// << some-string >> file-name
  55.  
  56. where the sed quote character (e.g. '/') can be anything and the sed
  57. 'X' character can be anything. Additionally, the ordering of the
  58. arguments is unimportant as is whether a space follows the indirection
  59. operators. In other words, this would also be accepted:
  60. cat >file-name <<"some string"
  61.  
  62. Just as a side note, it was compiled under lattice 4.0. It should be
  63. fairly portable, but I make no guarrantees.
  64.  
  65. If you have any comments, suggestions, or you just want to say hi, I
  66. can be reached at:
  67. guilford@turing.cs.rpi.edu
  68. guilford@csv.rpi.edu
  69. ...!rutgers!nysernic!rpics!guilford
  70.  
  71.